package com.myhexin.alert.config;

import com.myhexin.alert.properties.AlertProperties;
import com.myhexin.alert.service.AlertSender;
import com.myhexin.alert.service.impl.VanishAlertSenderImpl;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Jayce
 * @version 1.0.0
 * @date 2021/10/7
 * @desc
 */
@EnableConfigurationProperties(value = AlertProperties.class)
@Configuration
public class AlertAutoConfiguration {
    /**
     *  vanish发送告警信息的实现类
     */
    @Bean
    public AlertSender vanishAlertSender(AlertProperties alertProperties){
        return new VanishAlertSenderImpl(alertProperties.getVanish());
    }
}
